package com.example.demo.springbootdemo.mapper;

import com.example.demo.springbootdemo.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageInfoMapper {

    /**
     * 查询所有
     */
    @Select("select * from message_info where delete_flag = 0")
    List<MessageInfo> queryMessageInfos();


    /**
     * 添加
     */
    @Insert("insert into message_info (`from`, `to`, message)" +
            "values (#{from}, #{to}, #{message})")
    Boolean insertMessageInfo(MessageInfo messageInfo);
}
